<script>
	let name = 'tsfffffffff';
	function start(e) {
		console.log(e);
	}
	import Ts from './components/transtions.svelte';
	import Star from './components/start.svelte';
	setTimeout(() => (name = '可以的'), 1000);
	function coolAction(e, i) {
		e.innerHTML = i.name;
		e.style.background = i.color;
		// e.onclick = () => alert(name)
		return {
			update(i) {
				console.log('我有改动了', name);
			},
			destroy() {}
		};
	}
</script>

<div class="w-20 h-20 bg-purple-700 " draggable="true" ondragstart={start}>{name}</div>
<Ts />
<div class="w-64 h-64 border-gray-100 ">{name}</div>

<div use:coolAction={{ name, color: 'green' }} />
<div use:coolAction={{ name, color: 'blue' }} />
<Star />
